package com.nuist.springioc.config;

import com.nuist.springioc.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class BeanConfig {
//    @Primary
    @Bean
    public UserInfo user() {
        UserInfo userInfo = new UserInfo();
        userInfo.setAge(14);
        userInfo.setName("zhangsan");
        return userInfo;
    }

    @Bean
    public UserInfo user2() {
        UserInfo userInfo = new UserInfo();
        userInfo.setAge(15);
        userInfo.setName("lisi");
        return userInfo;
    }
}
